﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebPortal._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Ultimus Home</title>
    <script src="Content/js/jquery.min.js" type="text/javascript"></script>
    <script src="Content/js/bootstrap.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        function fav() {
            url = "Default.aspx";
            title = "Ultimus BPM";
            window.external.addFavorite(url, title);
        }

        function help() {
            window.open('http://www.ultimus.com.cn');
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="container-fluid" style="background-color: #FBFBFC;">
        <div class="row-fluid">
            <div class="span3">
            <a href="Default.aspx">
                <img src="Content/img/logo.gif" alt="Logo" style="height: 51px; width: 212px" /></a>
            </div>
            <div class="input-prepend  span4 offset2" style="margin-top: 15px">
                <span class="add-on"><i class="icon-search"></i></span>
                <input id="txtSearch" type="text" style="width: 300px; margin-right: 5px" />
                <input id="btnSearch" class="btn btn-primary" type="button" value="搜索" />
            </div>
            <div class="span3">
                <p class="navbar-text pull-right">
                    欢迎您 <a href="#" class="navbar-link">
                        <%=App.Integration.SSOUtil.Context.GetLoginedUser().UserFullName %></a> <a data-toggle="modal"
                            href="#logout" class="navbar-link">退出</a>
                </p>
            </div>
        </div>
    <hr style="margin-bottom:0;"/>
    </div>
    <br />
    <%--<div class="navbar">
        <div class="navbar-inner">
            <div class="container-fluid">
                <div class="nav-collapse collapse">
                    <ul class="nav">
                        <li><a href="Default.aspx">首页</a></li>
                        <li style="display:none"><a href="#" onclick="fav();">收藏</a></li>
                        <li><a href="#" onclick="help();">帮助</a></li>
                    </ul>
                </div>
                <!--/.nav-collapse -->
            </div>
        </div>
    </div>--%>
    <div class="container-fluid">
        <div class="row-fluid">
            <div class="span2">
                <div class="well sidebar-nav">
                    <ul class="nav nav-list">
                        <li class="nav-header"><i class="icon-list-alt"></i>我的工作台</li>
                        <li class="item"><a href="#" onclick="menuClick(this,'Task/NewTask.aspx','新建申请');">新建申请</a></li>
                        <li class="item active"><a href="#" onclick="menuClick(this,'Task/TaskList.aspx','我的待办');">我的待办</a></li>
                        <li class="item"><a href="#" onclick="menuClick(this,'Task/TaskList.aspx?type=myapproval','我的已办');">我的已办</a></li>
                        <li class="item"><a href="#" onclick="menuClick(this,'Task/TaskList.aspx?type=myrequest','我的申请');">我的申请</a></li>
                    </ul>
                </div>
                <!--/.well -->
            </div>
            <!--/span-->
            <div class="span10">
                <iframe src="<%=defaultUrl %>" id="frmContent" name="frmContent" scrolling="no"
                    frameborder="0" width="100%" height="100%"></iframe>
            </div>
            <!--/span-->
        </div>
        <!--/row-->
        <hr />
        <footer>
        <p>&copy; Ultimus Client 2012</p>
      </footer>
    </div>
    <!-- Logout Window-->
    <div id="logout" class="modal hide fade">
        <div class="modal-header">
            <a class="close" data-dismiss="modal">&times;</a>
            <h3>
                退出系统</h3>
        </div>
        <div class="modal-body">
            <h4>
                您确定要退出系统吗？</h4>
        </div>
        <div class="modal-footer">
            <a href="Login.aspx" class="btn btn-primary">确定</a> <a href="#" class="btn" data-dismiss="modal">
                取消</a>
        </div>
    </div>
    <!--/.fluid-container-->
    <script type="text/javascript">
        var iframeids = ["frmContent"]
        var iframehide = "yes"

        self.moveTo(0, 0)
        self.resizeTo(screen.availWidth, screen.availHeight);

        function changeSize() {
            var dyniframe = new Array()
            for (i = 0; i < iframeids.length; i++) {
                if (document.getElementById) {
                    var d = document.getElementById(iframeids);
                    if (dyniframe && !window.opera) {
                        d.style.display = "block"
                        // FireFox 控制垂直滚动条高度
                        if (d.contentDocument && d.contentDocument.body.offsetHeight) {
                            d.height = d.contentDocument.body.offsetHeight;

                        }
                        // IE 控制垂直滚动条宽度
                        else if (d.Document && d.Document.body.scrollHeight) {
                            d.height = d.Document.body.scrollHeight;
                        }
                        // FireFox 控制水平滚动条高度
                        if (d.contentDocument && d.contentDocument.body.offsetWidth) {
                            d.width = d.contentDocument.body.scrollWidth;
                        }
                        // IE 控制水平滚动条宽度
                        else if (d.Document && d.Document.body.scrollWidth) {
                            d.width = d.Document.body.scrollWidth;
                        }
                    }
                }

                if ((document.all || document.getElementById) && iframehide == "no") {
                    var tempobj = document.all ? document.all[iframeids] : document.getElementById(iframeids)
                    tempobj.style.display = "block"
                }
            }
        }

        if (window.addEventListener) {
            window.addEventListener("load", changeSize, false)
        }
        else if (window.attachEvent) {
            window.attachEvent("onload", changeSize)
        }
        else {
            window.onload = changeSize
        }

        function menuClick(ele, url,menuname) {
            $(".item").attr("class", "item");
            $(ele).parent().attr("class", "item active");
            var iframe = document.getElementById("frmContent");
            menuname = encodeURIComponent(menuname);
            if (url.indexOf("?") > 0) {
                url = url + "&menuname=" + menuname;
            }
            else {
                url = url + "?menuname=" + menuname;
            }
            iframe.contentWindow.location.href = url;

            if (iframe.attachEvent) {
                iframe.attachEvent("onload", function () { changeSize(); });
            } else {
                iframe.onload = function () { changeSize(); };
            }
        }
    </script>
    </form>
</body>
</html>
